package com.sch.www.sys.feign;

import com.sch.www.common.base.ResultBean;
import com.sch.www.common.constData.ServerName;
import com.sch.www.common.feign.CustomFeignConfig;
import com.sch.www.sys.feign.factory.UserServiceClientFallbackFactory;
import com.sch.www.sys.orm.entity.manual.Account;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 用户服务
 *
 * @author tangyi
 * @date 2018-12-30 23:21
 */


@FeignClient(value = ServerName.SYS_API_SERVER, configuration = CustomFeignConfig.class, fallbackFactory = UserServiceClientFallbackFactory.class)
public interface AccountApi {

    /**
     * 根据用户名获取用户详细信息
     *
     * @param username username
     * @return User
     * @author tangyi
     * @date 2019/03/17 12:14
     */
    @GetMapping("/sys/v1/account/username/{username}")
    ResultBean<Account> getByUsername(@PathVariable("username") String username);

}
